package com.hl.card.modular.packBack.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.hl.card.common.persistence.dao.SalesDivisionMapper;
import com.hl.card.common.persistence.model.SalesDivision;
import com.hl.card.modular.packBack.service.ISalesDivisionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author huangpu
 * @since 2018-06-05
 */
@Service
public class SalesDivisionServiceImpl extends ServiceImpl<SalesDivisionMapper, SalesDivision> implements ISalesDivisionService {

    @Resource(name = "salesDivisionMapper")
    private SalesDivisionMapper salesDivisionMapper;

    @Override
    public List<SalesDivision> selectList() {
        List<SalesDivision> list = salesDivisionMapper.selectSales();
        return list;
    }



    @Override
    public void save(SalesDivision salesDivision ) {
        salesDivisionMapper.insert(salesDivision);
    }

    @Override
    public void delete(int id) {
        salesDivisionMapper.deleteById(id);
    }

    @Override
    public void update(SalesDivision salesDivision) {
        salesDivisionMapper.updateById(salesDivision);
    }


    @Override
    public SalesDivision selectById(Integer id) {
        return salesDivisionMapper.selectById(id);
    }

    @Override
    public SalesDivision selectByName(String goodsCode) {
        SalesDivision salesDivision = salesDivisionMapper.selectByName(goodsCode);
        return salesDivision;
    }

}
